import {defineStore} from "pinia";
import {ref} from "vue";

export const useServiceContainerStore = defineStore('serviceContainer', () => {
    let serviceContainerDataList = ref([]);
    let serviceContainerSearchData = ref({});
    let addOrUpdateDialog = ref(false);
    let deleteDialog = ref(false);
    let deployDialogVisible = ref(false);

    function resetServiceContainerDataList(info) {
        serviceContainerDataList.value = info
    }

    function resetServiceContainerSearchData(info) {
        serviceContainerSearchData.value = info
    }

    function resetAddOrUpdateDialog(flag) {
        addOrUpdateDialog.value = flag;
    }

    function resetDeleteDialog(flag) {
        deleteDialog.value = flag;
    }

    function resetDeployDialogVisible(flag) {
        deployDialogVisible.value = flag;
    }

    return { serviceContainerDataList, resetServiceContainerDataList, serviceContainerSearchData, resetServiceContainerSearchData,
        addOrUpdateDialog, resetAddOrUpdateDialog, deleteDialog, resetDeleteDialog, deployDialogVisible, resetDeployDialogVisible }
})